<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../dist/style/css/base.css">
    <script>
        var deviceWidth = document.documentElement.clientWidth;
        if (deviceWidth > 640) deviceWidth = 640;
        document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px';
    </script>
</head>

<body>

    <div class="warp">
        <!--header-->
        <header class="hd">
            <a href="javascript:history.go(-1)" class="l-icon only-icon">
                <i class="iconfont icon-left1"></i>    
            </a>

            <p class="tit2">
                忘记密码
            </p>
        </header>

        <div class="register-form">
            <div class="input-bar">
                <span>
                    <i class="iconfont icon-shouji"></i>
                </span>
                <input type="text" placeholder="请输入手机号码">
            </div>
            <div class="verifica-bar">
                <span>
                    <i class="iconfont icon-anquan"></i>
                </span>
                <input type="text" placeholder="请输入验证码">

                <a href="#111" class="sendmsg">
                     发送验证码
                 </a>
            </div>
            <div class="input-bar">
                <span>
                    <i class="iconfont icon-suo"></i>
                </span>
                <input type="password" placeholder="请输入新的密码">
            </div>
            <div class="input-bar">
                <span>
                    <i class="iconfont icon-suo"></i>
                </span>
                <input type="password" placeholder="再次输入密码">
            </div>
            <p class="clause">
                <a href="#123">《使用条款和用户协议》</a>
            </p>
            <a class="register-btn noOK-btn">
                注册并登陆
            </a>

            <p class="gologin">
                <a href="./login.html">已有账号直接登录</a>
            </p>
        </div>



    </div>


    <script src="../dist/js/base.js"></script>

    <script>
        // 矫正rem
        function correctrem() {
            var rem_full_width = $("<div id='rem-test' style='width:7.5rem'></div>").appendTo($('body')).width();
            var device_width = Math.min(document.documentElement.clientWidth, 640);
            if (rem_full_width !== device_width) {
                document.documentElement.style.fontSize = (device_width / 7.5) * (device_width / rem_full_width) + 'px';
            }
            $('#rem-test').remove();
        }
        correctrem();
        $(function () {

        })

        function toastShow(str) {
            var $toast = $(".toast-box");

            if (!$toast.length) {
                $toast = $('<div class="toast-box"></div>');
                $toast.html(str);
                $("body").append($toast);
                setTimeout(function () {
                    $toast.addClass("none");
                }, 3000);
            } else {
                if ($toast.hasClass("none")) {
                    $toast.html(str);
                    $toast.removeClass("none");
                    setTimeout(function () {
                        $toast.addClass("none");
                    }, 3000);
                }
            }

        }
        toastShow("验证码有误");

        // $("input").on("change",function(){
        //     // console.log("???")
        // })
        $('input').bind('input propertychange', function () {
            var ok = true;
            $('input').each(function(i,item){
                if(!$.trim($(item).val())){
                    ok = false;
                }                
            })
            if(ok){                
                $(".register-btn").removeClass("noOK-btn");
            }
            else{
                 $(".register-btn").addClass("noOK-btn");
            }            
        });
    </script>

</body>

</html>